﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
using Billing.Controls;
using Billing.Utilities;

namespace Billing
{
    public partial class FirstBillForm : Form
    {
        PaperSize psize;

        public FirstBillForm()
        {
            InitializeComponent();
        }

        private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
        {
            //e.PageSettings.PaperSize = psize;
            e.Graphics.DrawString("KS BAKERS", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 140, 0);
            e.Graphics.DrawString("BHAGYA NAGAR COLONY. PH 000000000", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 20);
            e.Graphics.DrawString("TIN NO.28952015564", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 100, 40);
            /*e.Graphics.DrawString("Cashier Name: " + Storage.LoginUser, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 60);
            e.Graphics.DrawString("Date : " + DateTime.Now.ToString("dd/MM/yyyy") + "     Time : " + DateTime.Now.ToShortTimeString() + "          Bill No : " + Storage.BillNo, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 75);
            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 90);
            e.Graphics.DrawString("Item Name                         Rate            Qty           Amount", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 105);
            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 120);

            int lineCounter = 135;
            double totalAmt = 0d;
            foreach (BillingGridItemControl item in PrintCommon.PrintItems)
            {
                double totalPrice = double.Parse(item.txtPrice.Text);
                double qty = double.Parse(item.txtQty.Text);
                totalQty += qty;
                totalAmt += totalPrice;

                e.Graphics.DrawString(item.txtDesc.Text, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, lineCounter);
                e.Graphics.DrawString((totalPrice / qty).ToString(), new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, lineCounter);
                e.Graphics.DrawString(item.txtQty.Text, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, lineCounter);
                e.Graphics.DrawString(item.txtPrice.Text, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, lineCounter);

                lineCounter += 15;
            }

            /*e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 135);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 135);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 135);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 135);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 150);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 150);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 150);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 150);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 165);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 165);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 165);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 165);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 180);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 180);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 180);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 180);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 195);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 195);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 195);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 195);
            

            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 205);

            e.Graphics.DrawString("Items: " + 5, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 220);

            e.Graphics.DrawString("Total Payable: 36.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 240);
            e.Graphics.DrawString(string.Empty, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 250);
            //e.Graphics.DrawString("", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 265);
            //e.Graphics.DrawString("  Veg Samosa                        24.00            2            48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 135);
            //e.Graphics.DrawString("  Pav Baji                          12.00            2            24.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 155);
             */
            /*e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, lineCounter);
            lineCounter += 15;
            e.Graphics.DrawString("Items: " + PrintCommon.PrintItems.Count + "                                            Total Qty: " + totalQty.ToString(), new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);
            lineCounter += 20;
            e.Graphics.DrawString("Total Payable: " + Storage.PayableAmt + "/-", new Font("times new roman", 14, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 210, lineCounter);
            
            if (Storage.DiscountByPercentage != null && Storage.DiscountByPercentage != string.Empty)
                e.Graphics.DrawString("Discount @ " + Storage.DiscountByPercentage + " % = -" + Storage.DiscountedAmt + "/-", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);
            else if (Storage.DiscountByRs != null && Storage.DiscountByRs != string.Empty)
                e.Graphics.DrawString("Discount = -" + Storage.DiscountedAmt + "/-", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);
            
            lineCounter += 10;
            
            e.Graphics.DrawString(string.Empty,  new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);*/



            //TESTING

            /*
             * e.PageSettings.PaperSize = psize;
                /*e.Graphics.DrawString("KS BAKERS", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 140, 0);
                e.Graphics.DrawString("BHAGYA NAGAR COLONY. PH 000000000", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 20);
                e.Graphics.DrawString("TIN NO.28952015564", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 100, 40);
                */
            e.Graphics.DrawString("Cashier Name: " + Storage.LoginUser, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 0);
            e.Graphics.DrawString("Date : " + DateTime.Now.ToString("dd/MM/yyyy") + "     Time : " + DateTime.Now.ToShortTimeString() + "          Bill No : " + Storage.BillNo, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 15);
            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 30);
            e.Graphics.DrawString("Item Name                         Rate            Qty           Amount", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 45);
            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 60);

            int lineCounter = 75;
            double totalAmt = 0d;
            double totalQty = 0d;
            foreach (BillingGridItemControl item in PrintCommon.PrintItems)
            {
                double totalPrice = double.Parse(item.txtPrice.Text);
                double qty = double.Parse(item.txtQty.Text);
                totalQty += qty;
                totalAmt += totalPrice;

                e.Graphics.DrawString(item.txtDesc.Text, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, lineCounter);
                e.Graphics.DrawString((totalPrice / qty).ToString(), new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, lineCounter);
                e.Graphics.DrawString(item.txtQty.Text, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, lineCounter);
                e.Graphics.DrawString(item.txtPrice.Text, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, lineCounter);

                lineCounter += 15;
            }

            /*e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 135);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 135);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 135);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 135);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 150);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 150);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 150);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 150);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 165);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 165);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 165);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 165);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 180);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 180);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 180);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 180);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 195);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 185, 195);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 275, 195);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 340, 195);
            

            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, 205);

            e.Graphics.DrawString("Items: " + 5, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 220);

            e.Graphics.DrawString("Total Payable: 36.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 240);
            e.Graphics.DrawString(string.Empty, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, 250);
            //e.Graphics.DrawString("", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 265);
            //e.Graphics.DrawString("  Veg Samosa                        24.00            2            48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 135);
            //e.Graphics.DrawString("  Pav Baji                          12.00            2            24.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 155);
             */
            /*e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, lineCounter);
            lineCounter += 15;
            e.Graphics.DrawString("Items: " + PrintCommon.PrintItems.Count + "                                            Total Qty: " + totalQty.ToString(), new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);
            lineCounter += 20;
            e.Graphics.DrawString("Total Payable: " + Storage.PayableAmt + "/-", new Font("times new roman", 14, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 210, lineCounter);

            if (Storage.DiscountByPercentage != null && Storage.DiscountByPercentage != string.Empty)
                e.Graphics.DrawString("Discount @ " + Storage.DiscountByPercentage + " % = -" + Storage.DiscountedAmt + "/-", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);
            else if (Storage.DiscountByRs != null && Storage.DiscountByRs != string.Empty)
                e.Graphics.DrawString("Discount = -" + Storage.DiscountedAmt + "/-", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);

            lineCounter += 40;

            e.Graphics.DrawString("KS BAKERS", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 140, lineCounter);
            lineCounter += 20;
            e.Graphics.DrawString("BHAGYA NAGAR COLONY. PH 000000000", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 10, lineCounter);
            lineCounter += 20;
            e.Graphics.DrawString("TIN NO.28952015564", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 100, lineCounter);
            lineCounter += 10;
            e.Graphics.DrawString(string.Empty, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), System.Drawing.Brushes.Black, 20, lineCounter);
            */

        }

        private void printDocument1_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e)
        {
            psize = new PaperSize("saurabh", 400, 75);
            e.PageSettings.PaperSize = psize;
        }

        /*private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            //e.PageSettings.PaperSize = psize;
            e.Graphics.DrawString("KS BAKERS", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), Brushes.Black, 140, 0);
            e.Graphics.DrawString("BHAGYA NAGAR COLONY. PH 000000000", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 20);
            e.Graphics.DrawString("TIN NO.28952015564", new Font("times new roman", 13, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 40);
            e.Graphics.DrawString("Cashier Name: " + "Login Name", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 60);
            e.Graphics.DrawString("Date : " + DateTime.Now.ToString("dd/MM/yyyy") + "     Time : " + DateTime.Now.ToShortTimeString(), new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 75);
            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 90);
            e.Graphics.DrawString("Item Name                         Rate            Qty           Amount", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 105);
            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 120);
            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 135);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 185, 135);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 275, 135);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 340, 135);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 150);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 185, 150);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 275, 150);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 340, 150);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 165);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 185, 165);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 275, 165);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 340, 165);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 180);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 185, 180);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 275, 180);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 340, 180);

            e.Graphics.DrawString("Veg Samosa", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 195);
            e.Graphics.DrawString("12.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 185, 195);
            e.Graphics.DrawString("2", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 275, 195);
            e.Graphics.DrawString("48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 340, 195);

            e.Graphics.DrawString("------------------------------------------------------------------------------", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 205);

            e.Graphics.DrawString("Items: " + 5, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 220);

            e.Graphics.DrawString("Total Payable: 36.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 240);
            e.Graphics.DrawString(string.Empty, new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 250);
            //e.Graphics.DrawString("", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 20, 265);
            //e.Graphics.DrawString("  Veg Samosa                        24.00            2            48.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 135);
            //e.Graphics.DrawString("  Pav Baji                          12.00            2            24.00", new Font("times new roman", 10, System.Drawing.FontStyle.Regular), Brushes.Black, 10, 155);
        }

        private void printDocument1_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e)
        {
            psize = new PaperSize("saurabh", 400, 265);
            //psize = new PaperSize("saurabh", 400, 195);
            e.PageSettings.PaperSize = psize;
        }*/
    }
}
